package com.tjp.eight.utils;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;

import com.tjp.eight.ui.activity.ActivityFragmentDetail;
import com.tjp.eight.ui.fragment.ActivityWeb;
import com.tjp.eight.ui.fragment.collection.ActivityCollection;
import com.tjp.eight.ui.fragment.comment.CommentActivity;
import com.tjp.eight.ui.fragment.commentdetails.ActivityCommentDetails;
import com.tjp.eight.ui.fragment.detailjb.ActivityDetailJinBi;
import com.tjp.eight.ui.fragment.help.ActivityHelp;
import com.tjp.eight.ui.fragment.homepage.HomePageActivity;
import com.tjp.eight.ui.fragment.jifen.ActivityIntegrationTask;
import com.tjp.eight.ui.fragment.jifen.shareget.ActivityShareGet;
import com.tjp.eight.ui.fragment.jifenshop.ActivityJFShop;
import com.tjp.eight.ui.fragment.loginreg.ActivityLogin;
import com.tjp.eight.ui.fragment.modysec.ActivityModySec;
import com.tjp.eight.ui.fragment.mydynamic.ActivityMyDynamic;
import com.tjp.eight.ui.fragment.mymsg.ActivityMyMsg;
import com.tjp.eight.ui.fragment.mymsg.receicezan.ActivityReceiveZan;
import com.tjp.eight.ui.fragment.mymsg.receivecomment.ActivityWhoComment;
import com.tjp.eight.ui.fragment.mywallet.ActivityMyWallet;
import com.tjp.eight.ui.fragment.otherhomepage.OtherHomePageActivity;
import com.tjp.eight.ui.fragment.personsetting.ActivityPersonSetting;
import com.tjp.eight.ui.fragment.report.ActivityReport;
import com.tjp.eight.ui.fragment.rock.RockActivity;
import com.tjp.eight.ui.fragment.search.ActivitySearch;
import com.tjp.eight.ui.fragment.setting.ActivitySetting;
import com.tjp.eight.ui.fragment.setting.aboutus.ActivityAboutUs;
import com.tjp.eight.ui.fragment.subdetails.ActivitySubDetail;
import com.tjp.eight.ui.fragment.whozan.ActivityWhoZan;

/**
 * Created by Administrator on 2017/2/27.
 */
public class ActivityUtils {
    public static void startReport(Context context, String cid) {
        Intent intent = new Intent(context, ActivityReport.class);
        intent.putExtra("cid", cid);
        context.startActivity(intent);
    }

    public static void startMyMsg(Context context) {
        Intent intent = new Intent(context, ActivityMyMsg.class);
        context.startActivity(intent);
    }

    public static void startModyPass(Context context) {
        Intent intent = new Intent(context, ActivityModySec.class);
        context.startActivity(intent);
    }

    public static void startWhoZan(Context context) {
        Intent intent = new Intent(context, ActivityReceiveZan.class);
        context.startActivity(intent);
    }

    public static void startWhoZan_(Context context, String coid) {
        Intent intent = new Intent(context, ActivityWhoZan.class);
        intent.putExtra("coid", coid);
        context.startActivity(intent);
    }

    public static void startWhoComment(FragmentActivity activity) {
        Intent i = new Intent(activity, ActivityWhoComment.class);
        activity.startActivity(i);
    }

    public static void startSearch(FragmentActivity activity) {
        Intent i = new Intent(activity, ActivitySearch.class);
        activity.startActivity(i);
    }

    public static void startMyDynamic(Context context) {
        Intent intent = new Intent(context, ActivityMyDynamic.class);
        context.startActivity(intent);
    }

    public static void startIntegrationTask(Context context) {
        Intent intent = new Intent(context, ActivityIntegrationTask.class);
        context.startActivity(intent);
    }

    public static void startShareGet(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivityShareGet.class);
        activity.startActivity(intent);
    }

    public static void startMyWallet(FragmentActivity activity, String money) {
        Intent intent = new Intent(activity, ActivityMyWallet.class);
        intent.putExtra("money", money);
        activity.startActivity(intent);
    }

    public static void startPersonSetting(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivityPersonSetting.class);
        activity.startActivity(intent);
    }

    public static void startSetting(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivitySetting.class);
        activity.startActivity(intent);
    }

    public static void startCollection(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivityCollection.class);
        activity.startActivity(intent);
    }

    public static void startLoginForResult(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivityLogin.class);
        activity.startActivityForResult(intent, 0x01);
    }

    public static void startHelp(FragmentActivity activity) {
        Intent intent = new Intent(activity, ActivityHelp.class);
        activity.startActivity(intent);
    }

    public static void startDetails(Context activity, String caid) {
        Intent intent = new Intent(activity, ActivityFragmentDetail.class);
        intent.putExtra("caid", "" + caid);
        activity.startActivity(intent);
    }

    public static void startSubDetails(Context activity, String title, String caid) {
        Intent intent = new Intent(activity, ActivitySubDetail.class);
        intent.putExtra("title", "" + title);
        intent.putExtra("caid", "" + caid);
        activity.startActivity(intent);
    }

    public static void startComment(FragmentActivity activity, String caid) {
        Intent intent = new Intent(activity, CommentActivity.class);
        intent.putExtra("cid", caid);
        activity.startActivity(intent);
    }

    public static void startCommentDetails(Context activity, String coid, String cid) {
        Intent intent = new Intent(activity, ActivityCommentDetails.class);
        intent.putExtra("coid", coid);
        intent.putExtra("cid", cid);

        activity.startActivity(intent);
    }

    public static void startOtherHomePage(Context context, String uid) {
        if (StringUtils.isNullOrEmpty(uid)) {
            return;
        }
        String tem_uid = SharePreferencesUtils.getUid();
        if (!StringUtils.isNullOrEmpty(tem_uid) && tem_uid.equals(uid)) {
            context.startActivity(new Intent(context, HomePageActivity.class));
            return;
        }
        Intent intent = new Intent(context, OtherHomePageActivity.class);
        intent.putExtra("uid", uid);
        context.startActivity(intent);
    }

    public static void startJFShop(FragmentActivity activity, String money) {
        Intent intent = new Intent(activity, ActivityJFShop.class);
        intent.putExtra("money", money);
        activity.startActivity(intent);
    }

    public static void startAboutUs(FragmentActivity activity) {
        activity.startActivity(new Intent(activity, ActivityAboutUs.class));
    }

    public static void startWeb(FragmentActivity activity, String title, String url) {
        Intent intent = new Intent(activity, ActivityWeb.class);
        intent.putExtra("title", title);
        intent.putExtra("url", url);
        activity.startActivity(intent);
    }

    public static void startJinBi(FragmentActivity activity) {
        activity.startActivity(new Intent(activity, ActivityDetailJinBi.class));
    }

    public static void startRock(FragmentActivity activity) {
        activity.startActivity(new Intent(activity, RockActivity.class));
    }
}
